![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@thi.ng/arrays
Advanced tools
[!NOTE] This is one of 201 standalone projects, maintained as part of the @thi.ng/umbrella monorepo and anti-framework.
🚀 Please help me to work full-time on these projects by sponsoring me on GitHub. Thank you! ❤️
Array / Arraylike utilities.
STABLE - used in production
Search or submit any issues for this package
yarn add @thi.ng/arrays
ESM import:
import * as arr from "@thi.ng/arrays";
Browser ESM import:
<script type="module" src="https://esm.run/@thi.ng/arrays"></script>
For Node.js REPL:
const arr = await import("@thi.ng/arrays");
Package sizes (brotli'd, pre-treeshake): ESM: 3.00 KB
Note: @thi.ng/api is in most cases a type-only import (not used at runtime)
Six projects in this repo's /examples directory are using this package:
Screenshot | Description | Live demo | Source |
---|---|---|---|
![]() | k-means clustering visualization | Demo | Source |
![]() | Randomized 4-point 2D color gradient image generator | Demo | Source |
![]() | Animated, iterative polygon subdivisions & visualization | Demo | Source |
![]() | Responsive image gallery with tag-based Jaccard similarity ranking | Demo | Source |
![]() | Responsive & reactively computed stacked column layout | Demo | Source |
![]() | Tree-based UI to find & explore thi.ng projects via their associated keywords | Demo | Source |
arrayIterator()
argMin()
/ argMax()
argSort()
binarySearch()
bisect()
blit1d()
/ blit2d()endsWith()
ensureArray()
ensureIterable()
fillRange()
find()
findSequence()
floydRivest()
fuzzyMatch()
insert()
into()
isSorted()
levenshtein()
multiSwap()
peek()
quickSort()
rotate()
/ rotateTyped()
selectThresholdMin()
/ selectThresholdMax()
shuffle()
(w/ custom PRNG support)shuffleRange()
(w/ custom PRNG support)sortByCachedKey()
startsWith()
swap()
swizzle()
topoSort()
The following predicates can be used to perform predecessor / successor
queries using binarySearch()
.
bsLT()
- Returns index of last item less than search value or -1 if
no such values existbsLE()
- Similar to bsLT()
, but for less-than-equals queriesbsGT()
- Returns index of first item greater than search value or -1
if no such values existbsGE()
- Similar to bsGT()
, but for less-than-equals queriesbsEQ()
- Merely syntax sugar, casting any non-found result indices to -1import { binarySearch, bsGT, bsLT } from "@thi.ng/arrays";
const src = [10, 20, 30, 40];
bsLT(binarySearch(src, 25))
// 1
// greater-than queries also require the array length
bsGT(binarySearch(src, 25), src.length)
// 2
bsGT(binarySearch(src, 40), src.length)
// -1
If this project contributes to an academic publication, please cite it as:
@misc{thing-arrays,
title = "@thi.ng/arrays",
author = "Karsten Schmidt",
note = "https://thi.ng/arrays",
year = 2018
}
© 2018 - 2025 Karsten Schmidt // Apache License 2.0
FAQs
Array / Arraylike utilities
We found that @thi.ng/arrays demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.